package kr.co.redbean.frame
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.Font;
	
	public class MainFrame extends Sprite
	{
		static public const FRAME_WIDTH:uint = 1000;
		static public const FRAME_HEIGHT:uint = 600;
		static public const MENUBAR_HEIGHT:uint = 20;
		static public const MAINMENU_WIDTH:uint = 354;
		
		[Embed( mimeType='application/x-font-truetype', source='../asset/HelveticaNeueLTCom-Ex.ttf', fontName='HelveticaNeue', embedAsCFF=false)]
		private var _defaultFont:Class;
		
		private var _posS:Object;
		private var _posF:Object;
		
		public function MainFrame()
		{
			super();
			addEventListener(Event.ADDED_TO_STAGE, setPos);
		}
		
		private function setFont():void {
			Font.registerFont(_defaultFont);
		}
		
		private function setPos($e:Event=null):void {
			if($e.toString() == Event.ADDED_TO_STAGE) {
				removeEventListener(Event.ADDED_TO_STAGE, setPos);
			}
			stage.addEventListener(Event.RESIZE, setPos);
			
			_posS = {};
			_posF = {};
			_posS.left = 0;
			_posS.right = stage.stageWidth;
			_posS.top = 0;
			_posS.bottom = stage.stageHeight;
			_posF.left = _posS.right/2 - FRAME_WIDTH/2;
			_posF.right = _posS.right - _posF.left;
			_posF.top = _posS.bottom/2 - FRAME_HEIGHT/2;
			_posF.bottom = _posS.bottom - _posF.top;
		}

		public function get posS():Object
		{
			return _posS;
		}

		public function get posF():Object
		{
			return _posF;
		}


	}
}